1. Field of the Invention
The present invention relates to a data processing apparatus for electronic musical instruments, and, more particularly, to the architecture of a data processing apparatus for electronic musical instruments.
2. Description of the Related Art
Although recent electronic musical instruments are computerized, that portion associated with tone generation which requires a high-speed computation of a vast amount of data, is still excited by exclusive or special-purpose hardware called a sound source circuit. A microcomputer merely processes control inputs to a musical instrument, such as an input from a keyboard or console panel, input from a MIDI or other external units and input from an internal or external unit, and sends proper commands to the sound source circuit.
Sound source circuits, which have different structures depending on the system for generating musical tones, normally have a large circuit scale irrespective of the structure of the sound source systems. The circuit scale of typical sound source circuits is about two times that of a microcomputer (central processing unit).
FIG. 1 exemplifies in a block diagram of a sound source circuit involving a PCM sound source (refer to the U.S. patent application Ser. No. 226,936, filed on Aug. 1, 1988 now U.S. Pat. No. 5,007,323). A microcomputer 2, which controls a PCM sound source 1, sends data (command) necessary for tone generation to the PCM sound source 1. Such a command is set in individual sections in the sound source through a sound source command analyzer 3.
For instance, data is set through the following procedures at the beginning of tone generation.
(a) Addresses (normally consisting of a start address, end address and loop address) to be waveform memory 8, in which waveforms to be generated are stored, are sent and set in an address controller 5.
(b) Pitch data of a musical tone to be generated is sent and set in a pitch controller 6.
(c) Envelope data is sent and set in an envelope controller 7.
(d) Channel control is set ON (data is set in a channel ON/OFF controller 4).
With the use of a polyphonic sound source, these data should have a matched channel number and the individual sections of the sound source 1 should be operated in time-sharing manner. When the above data is set the PCM sound source 1 produces a musical tone in the following manner. The address controller 5 reads out from the waveform memory 8 waveform data located at two adjacent addresses closest to an accumulated result of the pitch data from the pitch controller 6, the waveform data representing an immediately preceding waveform value and an immediately following waveform value. The waveform data is sent to a waveform processor 9 which in turn computes the difference between these two waveform values. The difference and the immediately preceding waveform value are sent to a multiplier 10, which multiplies the computed difference by a decimal point portion PD of the address of the waveform memory (given from the pitch controller 6 in the diagram) and adds the immediately preceding waveform value to the resultant value to thereby provide an interpolation value. The multiplier 10 then multiplies this interpolation value by an envelope value ED produced in the envelope controller 7, thus providing an instantaneous value of a tone waveform of the channel. This instantaneous value is accumulated by an adder 11 for all the channels, and the resultant data is sent to a D/A converter 12 to be an analog tone signal.
As is obvious from this example, it is necessary to provide an arithmetic operation unit and a memory for temporary storage of data, here and there at the data processing storage, thus requiring a large-scale circuit. A specific sound source circuit has a structure to simply realize a specific sound source system and 1 or combination of a specific number of polyphonic sounds, so that changing the polyphonic number necessitates great alteration of the circuit and/or addition of a circuit. It is also necessary to design a set of commands to be sent to the sound source circuit from the microcomputer in accordance with the sound source, thus requiring a significant time for developing a sound source control program.
There may be a controller for an electronic musical instrument whose architecture permits a microcomputer alone to simultaneously execute processing of control inputs to a musical instrument and tone generation. To realize such a controller, there is a demand for a microcomputer having an architecture to ensure tone generation that requires a high-speed data processing of a vast amount of data.
For instance, typical microcomputers use an internal register or a general-purpose internal register, called an accumulator, as memory means for temporary storage of computing data. The accumulator may hold data from a data memory on one occasion, and holds the result of computation (e.g., addition) of two pieces of data from the data memory performed by a computing circuit on another occasion. Data temporarily held in the accumulator is sent back to the memory location specified on the data memory. Using a microcomputer with such a structure for tone generation requires a considerable time for frequent data transfer between the data memory and the accumulator (or general-purpose register) and thus becomes a hindrance to achieving tone generation processing that should deal with a vast amount of data.
A description will now be given of the envelope controller 7 (envelope generator) which is incorporated in hardware of a sound source circuit. FIG. 2 illustrates a typical envelope controller. Various values from a microcomputer are set in an envelope .DELTA.x register 24, an envelope .DELTA.y register 25 and a target envelope register 26 via the sound source analyzer 3 which serves as an interface. In operation, the content of an envelope .DELTA.x timer 21 is counted up by an INC counter 22. When the count value of this timer 21 coincides with the content of the envelope .DELTA.y register 24, a comparator 23 outputs a coincidence signal to clear the INC counter 22. The coincidence signal further opens an AND gate G1, and data .DELTA.y from the envelope .DELTA.y register 25 is input to an adder-subtracter 27. This data .DELTA.y is added to or subtracted from a present envelope value from a present envelope resister 29 in accordance with an adding/subtracting flag (a specific bit of the envelope .DELTA.y resister 25). The result of the computation is compared with a target envelope level from a target envelope register 29 by a second comparator 28. The comparison result is used to determine a new present envelope value. In other words, if the computed result has not reached the target envelope, it is output as a new present envelope value via a gate G2 and set back to the resister 29. If the computed result reaches the target envelope, however, the coincidence signal from the comparator 28 opens a gate G3 through an inverter INV to output the target envelope as a new present envelope value, which is then set back to the register 29. The coincidence signal from the comparator 28 is held in a coincidence signal holding circuit 30 to request setting of data of the next envelope step (.DELTA.x, .DELTA.y, a target envelope).
The envelope generator as shown in FIG. 2 has a shortcoming that it is part of the hardware of the sound source circuit. Once the microcomputer sets data of .DELTA.x, .DELTA.y and the target value, therefore, it cannot grasp a present envelope value thereafter. (Permitting the microcomputer to read out the present envelope value, though possible, requires a significantly complex circuit.) When it is necessary to jump the envelope step, therefore, it is difficult to set .DELTA.x, .DELTA.y, the target value) suitable for the present envelope value. Assuming that data for a release envelope which consists of three segments is on the microcomputer side as shown in FIG. 3, due to the present envelope value unclear, the microcomputer cannot determine data (.DELTA.x, .DELTA.y, the target value) to which segment should be sent to the sound source. A conventional solution to this problem is to send an envelope step update signal (the output of the coincidence signal holding circuit 30 in FIG. 2) to the microcomputer to request updating of the step and to transfer data for the next step to the sound source from the microcomputer. With this arrangement, although the microcomputer cannot grasp the present envelope value being produced by the sound source, it can grasp the envelope step being executed by the sound source. This permits the microcomputer to select release envelope segment corresponding to a value which this envelope step can take at a tone release time, i.e., a release envelope segment having a target value lower than but closest to the target value of the present envelope, then transfer data for the selected release envelope segment to the sound source. This particular design, however, has a problem that a zigzag line characteristic of a release envelope is restricted by another envelope portion. This is because that release envelope data should be prepared in advance to match with the range of the envelope value of another step, thus limiting characteristic that the envelope can have.
With a design to allow a microcomputer itself to generate musical tones, it is very difficult, if not impossible, to completely keep constant the period of the sample sequence of digital musical tones to be sent to a digital-to-analog (D/A) converter from the microcomputer due to the nature of a program-controlled operation. In other words, since the amount of processing that should be done by the microcomputer varies with time by inputs to the microcomputer, the amount of processing required for tone generation included in intended data processing also varies. This means a variation in period for generating a digital musical tone. When a digital musical tone varying in an unstable period is converted into an analog signal, the resultant musical tone would be distorted, which is very crucial to electronic musical instruments.